package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.demo.entity.Admin;
import com.example.demo.entity.Laboratory;
import com.example.demo.entity.User;
import com.example.demo.mapper.AdminMapper;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminService {
    @Autowired
    private RedisTemplate redisTemplate;

    @Autowired
    private AdminMapper adminMapper;

    public Admin login(String name, String password){
        return adminMapper.getLogIn(name,password);
    }
    public List<Admin> selectList(Admin admin){
        LambdaQueryWrapper<Admin> queryWrapper = Wrappers.lambdaQuery(admin);
        return adminMapper.selectList(queryWrapper);
    }

    public int delete(Long id){
        return adminMapper.deleteById(id);
    }
}
